<header th:fragment="header">
    <nav class="navbar navbar-expand-lg navbar-dark bg-primary">
        <a class="navbar-brand" href="#">Springboot系统</a>
        <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarColor01" aria-controls="navbarColor01" aria-expanded="false" aria-label="Toggle navigation">
            <span class="navbar-toggler-icon"></span>
        </button>

        <div class="collapse navbar-collapse" id="navbarColor01">
            <ul class="navbar-nav mr-auto">
                <li class="nav-item active">
                    <a class="nav-link" href="/">首页 <span class="sr-only">(current)</span></a>
                </li>
                <li class="nav-item" sec:authorize="!isAuthenticated()">
                    <a class="nav-link" href="/register">注册</a>
                </li>
                <li class="nav-item" sec:authorize="!isAuthenticated()">
                    <a class="nav-link" href="/login">登录</a>
                </li>
                <li class="nav-item" sec:authorize="isAuthenticated()">
                    <a class="nav-link" href="/profile">个人信息</a>
                </li>
                <li class="nav-item" sec:authorize="hasRole('ROLE_ADMIN')">
                    <a class="nav-link" href="/users">用户列表</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="#">关于</a>
                </li>
            </ul>
            <form class="form-inline my-2 my-lg-0" th:action="@{/logout}" method="post" sec:authorize="!isAuthenticated()">
                <input class="form-control mr-sm-2" type="hidden">
                <button class="btn btn-secondary my-2 my-sm-0" type="submit">登出</button>
            </form>
        </div>
    </nav>

</header>